home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 3
/
ct-rom iiib.zip
/
ct-rom iiib
/
WINDOWS
/
VIRUS
/
TBAVW624
/
TBAVWLNG.DOC
< prev
next >
Wrap
Text File
|
1994-09-15
|
16KB
|
345 lines
Technical information concearning the TBAVWIN language file.
============================================================
1. Introduction.
This document comprises technical information about the language file used by
the ThunderBYTE for Windows products.
THIS DOCUMENT IS NOT INTENDED FOR NOVICE USERS !
The language file may be viewed as an online resource description file, and
contains the definition and specification of menus, dialogs, global
items and more. Thus, if you need to change the TBAVWIN menu, or one of
the dialogs, just change the appropriate block in the language file.
This design of the language file brings very usefull properties along. Suppose
you're a system administrator and you have installed TBAVWIN, with those
options selected for the ThunderBYTE utilities that you think are important.
However, since the standard TBAVWIN menu comprises an item 'Quit TBAVWIN and
save', users can change the option settings, and save their own configuration.
With the language file, it is possible to completely remove the menu item 'Quit
TBAVWIN and save', so that users cannot save their settings anymore.
The language file is made up by a combination of resource blocks (called
Global, Menu and Dialog). We will continue this document by first
describing the general layout of the language file, and then describing the
purpose of the resource blocks.
2. General layout of the language file
The language file is a simple text-only file. It may contain comment-lines,
which begin with a semicolon (';'). Newlines or spaces can be inserted anywhere
within the file. All non-trivial lines (lines that are not empty and do not
contain comment) are made up of a statement and zero or more parameters, in a
fixed order. The statement definitions are case insensitive. The parameters
are enclosed within hooked brackets ('<' and '>') and can denote both a string
of characters or a number, depending on the statement and the parameter itself.
A number can be specified in decimal notation, or in hexadecimal notation. If
the latter is used, the number should be preceeded by '0x' or '0X'. If a
parameter is used to specify a string of characters, this parameter will
always be the last parameter in the list of parameters.
Let's examine the following excerpt of the language file:
;
; This is the ThunderBYTE Anti-Virus / Windows language file.
;
; UNLESS YOU ARE AN EXPERIENCED USER, DO NOT ALTER THE NON-TEXT BLOCKS !!!
;
GlobalBegin
Title <ThunderBYTE Anti-Virus Utilities for Windows>
String<55> <Error reading signature file>
String<0x38> <Error while allocating memory>
GlobalEnd
;
; The end...
In this excerpt, we see seven comment lines (the lines that begin with a
semicolon). Furthermore, one resource block is defined; the start is defined
by the line containing the statement 'GlobalBegin'. The block ends with the
line 'GlobalEnd'. Thus, this block defines the global resource block. The
block contains three statements, namely 'Title' and 'String'; the latter
statement appears twice. The first is used to specify the title of the program,
whilst the 'String' statement defines a global string resource. The Title
statement (which is also discussed later on in this file) has only one
parameter, which is a string of characters. As you can see, you can insert
spaces between the statement itself and its parameters. The String statement
has two parameters: a string identifier (in case of the first 'String'
specification the number 55, in case of the second this identifier is the
hexadecimal number 0x38 (56 in decimal representation)) and the string
specification. The String statement is described in more detail in the next
chapter.
THE STRING IDENTIFIER IS AN INTERNAL IDENTIFIER FOR THE TBAVWIN PROGRAM,
SO YOU SHOULD NOT ALTER THIS IDENTIFIER !
3. The Global resource block
The global resource block is defined by two lines: 'GlobalBegin', which
appears in the beginning of the block, and 'GlobalEnd' at the end of
the block. Within the Global block, you can use eleven statements, which
will be discussed in the sequel.
3.1 The Title statement
The 'Title' statement is used to specify the title of the TBAVWIN program.
It has only one parameter, with which the title text is defined.
3.2 The String statement
Within the TBAVWIN program, several global string resources are used. For
example, the text in the buttons of a dialog is a global string resource.
The 'String' statement needs two parameters: an identifier (the first
parameter) and a text-string (the second parameter).
THE STRING IDENTIFIER IS AN INTERNAL IDENTIFIER FOR THE TBAVWIN PROGRAM,
SO YOU SHOULD NOT ALTER THIS IDENTIFIER !
Here's a list of the most commonly used identifiers:
identifier | used in
-----------+----------------------------------
1 | the 'OK' button in a dialog
2 | the 'Cancel' button in a dialog
3 | the 'Abort' button in a dialog
4 | the 'Retry' button in a dialog
5 | the 'Ignore' button in a dialog
6 | the 'Yes' button in a dialog
7 | the 'No' button in a dialog
998 | the 'Help' button in a dialog
These identifiers are also used as a cross-reference in the dialog definitions
(refer to chapter 6, the chapter about the Dialog resource block)
In the second parameter of the 'String' statement, which defines the
text-string, you may insert two '~' characters to specify a newline. Thus, a
line like
String<15><First line~~Second line>
will appear on the screen as:
First line
Second line
3.3 The ColorDlgBg statement
With this 'ColorDlgBg' statement, you can specify the background color of
the dialogs used by the TBAVWIN program. Colors are specified using three
parameters, which respectively represent the intensity of the Red, Blue
and Green color components. This intensity can be any number from 0 up to
255, with 0 representing no intensity and 255 representing full intensity.
For example, if you want the dialog background to be bright red, you should
specify
ColorDlgBg<255><0><0>
If you want the background to be dark grey, you should specify
ColorDlgBg<128><128><128>
3.4 The ColorButton statement
The 'ColorButton' statement is used to specify the color of the buttons
in the dialogs used by the TBAVWIN program. Colors are specified using three
parameters, which respectively represent the intensity of the Red, Blue
and Green color components. This intensity can be any number from 0 up to
255, with 0 representing no intensity and 255 representing full intensity.
For an example, refer to section 3.3.
3.5 The ColorEdit statement
The 'ColorEdit' statement is used to specify the background color of edit
controls in the dialogs used by the TBAVWIN program. The foreground color
in an edit control can be specified using the 'ColorText' statement (section
3.10). Colors are specified using three parameters, which respectively
represent the intensity of the Red, Blue and Green color components. This
intensity can be any number from 0 up to 255, with 0 representing no
intensity and 255 representing full intensity. For an example, refer
to section 3.3.
3.6 The ColorListBox statement
The 'ColorListBox' statement is used to specify the color of list boxes
in the dialogs used by the TBAVWIN program. Colors are specified using three
parameters, which respectively represent the intensity of the Red, Blue
and Green color components. This intensity can be any number from 0 up to
255, with 0 representing no intensity and 255 representing full intensity.
For an example, refer to section 3.3.
3.7 The ColorScrBar statement
The 'ColorScrBar' statement is used to specify the color of the scroll bar
in the dialogs used by the TBAVWIN program. Colors are specified using three
parameters, which respectively represent the intensity of the Red, Blue
and Green color components. This intensity can be any number from 0 up to
255, with 0 representing no intensity and 255 representing full intensity.
For an example, refer to section 3.3.
3.8 The ColorStatic statement
The 'ColorStatic' statement is used to specify the color of static text
in the dialogs used by the TBAVWIN program. Colors are specified using three
parameters, which respectively represent the intensity of the Red, Blue
and Green color components. This intensity can be any number from 0 up to
255, with 0 representing no intensity and 255 representing full intensity.
For an example, refer to section 3.3.
3.9 The ColorText statement
The 'ColorButton' statement is used to specify the foreground color of text
in edit controls in the dialogs used by the TBAVWIN program. Colors are
specified using three parameters, which respectively represent the
intensity of the Red, Blue and Green color components. This intensity can
be any number from 0 up to 255, with 0 representing no intensity and 255
representing full intensity. For an example, refer to section 3.3.
4. The Menu resource block
The TBAVWIN menu is defined by the 'Menu' resource block. Such a block
starts with a line containing 'MenuBegin', and ends with a line containing
'MenuEnd'. Each menu is identified by a name, which is a parameter of the
line containing 'MenuBegin'. In the TBAVWIN program, only one menu is used
which is called 'MainMenu'. The Menu resource block is comprised by
'MenuPopup' blocks and 'MenuItem' statements, which will be discussed
in the sequel.
4.1 The MenuPopUp block
A popup menu can be specified using the MenuPopup block. Such a block starts
with a line containing 'MenuPopupStart' and ends with a line containing
'MenuPopupEnd'. With MS-Windows 3.1, it is possible to access popup menus
using the keyboard. To do so, you need to press the 'ALT' key and a key which
represents the popup menu simultaneoulsy. You can specify the key that
represents the popup menu in the menu name, by inserting a '&'-character before
the character that represents the key. The menu name is a paramater to the
line containing 'MenuPopupStart'. For example, suppose you have the following
MenuPopUpStart <&File>
MenuItem<100> <&Configure TBAVWIN...>
MenuSeparator
MenuItem<101> <&Quit and save>
MenuItem<102> <E&xit TBAVWIN>
MenuPopUpEnd
In this example, the name of the popup menu is 'File'. Since the character 'F'
in this name is preceeded by a '&' character, you can access the popup menu
by pressing the 'ALT' and 'F' key simultaneously.
A MenuPopUp block can contain other MenuPopUp blocks, and MenuItem and
MenuSeparator statements. A MenuSeparator causes a horizontal bar to appear
in the menu. This is illustrated by the previous example, which creates a menu
that looks like:
+ File ------------------+
| Configure TBAVWIN... |
| ---------------------- |
| Quit and save |
| Exit (no save) |
+------------------------+
The meaning of the MenuItem statement is described in the next section.
4.2 The MenuItem statement
Each menu item is comprised by a number and some character string. The number
is an identifier used internally by the TBAVWIN program and is specified by
the first parameter of the 'MenuItem' statement. The character string is
specified using the second parameter of the statement. In such a character
string you can again use the '&' character to identify a key with which you
can select the item using the keyboard. To explain this, we use the example
of section 5.1. If you have selected the menu (using the mouse, or by pressing
ALT+F on your keyboard, you can select the 'Quit and save' item, for example,
by pressing the 'Q' key on your keyboard, since the 'Q' character is preceeded
by a '&' character in the MenuItem statement.
5. The Dialog resource block
The last in the list of blocks is the Dialog resource block. Such a block
start with a line containing 'DialogBegin' and ends with a line containing
'DialogEnd'. The line containing 'DialogBegin' should have two parameters:
the first representing the dialog identifier used internally by the TBAVWIN
program, and the second representing the dialog title. The title parameter
can be an empty parameter (an opening bracket followed directly by a closing
bracket). Each Dialog resource block should contain a 'DialogStyle' statement,
a 'DialogSize' statements and one or more 'DialogControl' statements. These
statements will be discussed in further detail in the following sections.
5.1 The DialogStyle statement
Each dialog used with MS-Windows should have a certain style, which is
really a sequence of bits, each representing a sub-style. The 'DialogStyle'
statement is used to specify such styles. It has only one parameter,
representing a 32-bit word. THE DIALOG STYLE SHOULD NOT BE ALTERED.
5.2 The DialogSize statement
The 'DialogSize' statement defines the top-left position of the dialog,
and the width and height of the dialog. The first parameter of the statement
represents the horizontal co-ordinat of the top-left corner of the dialog;
the vertical co-ordinat is specified by the second parameter. The third
and fourth parameter respectively define the width and height of the
dialog. All four parameters use a single pixel as a unit.
5.3 The DialogControl statement
The 'DialogControl' statement is a very complex statement which can be used
to define buttons, list boxes, edit controls, static text, icons and more.
It should have seven or eight parameters. The first four parameters
respectively represent the horizontal co-ordinat of the top-left corner of the
control, the vertical co-ordinat of the top-left corner of the control, and
the width and height of the control. The fifth parameter represents the
control identifier and is used internally in the TBAVWIN program. The sixth
parameter is used to define the control style. THE CONTROL STYLE SHOULD NOT
BE ALTERED. The seventh parameter is used to define the kind of control:
Control Type | Kind of control
(Hexadecimal) |
--------------+---------------------------------------------------
0x80 | Button (pushbutton, radiobutton, checkmark, ....)
0x81 | Edit control
0x82 | Static (text, icon, ....)
0x83 | List box
0x84 | Scroll bar
0x85 | Combo box
If the control type equals 0x80 (button control), and the control identifier
(defined in parameter 5) equals one of the identifiers listed in the table of
section 3.2, no more parameters are needed. The TBAVWIN program automatically
searches the list of global string resources and links the string which has
the same identifier as the control, with the control. Thus, if you specify
a control like
DialogControl<60><100><32><20><1><0x50010000><0x80>
then TBAVWIN recognizes that this statement defines an 'OK' button, since
the control type equals 0x80, and the identifier equals 1. The string which
is assigned to the control is then copied from that string of the list of
global string resources, that has an identifier equal to 1.
In any other case, a character string must be specified in the eight
parameter. The string may be empty (an opening bracket may be followed directly
by a closing bracket). In such a character string you can use the '&'
character to identify a key with which you can select the item using
the keyboard. Refer to chapter 4 for an explanation on this topic.